/**
 * Created by yangxianming on 2018/4/20.
 */

//加载左侧栏位
var xmlHttp1 = new XMLHttpRequest();

//打开页面后 需要加载一些数据
html2canvas(document.body).then(function(canvas) {
    document.body.appendChild(canvas);
});

function openPic(){
    document.getElementById("pic").innerText = "";
    controlOpenPic('openPic', "open", "");
    html2canvas(document.getElementById('capture')).then(function(canvas){document.getElementById('pic').appendChild(canvas);});
}

function controlOpenPic(whichWindow, mySwitch, text){
    var topDiv = document.getElementById(whichWindow);
    if (mySwitch == "open") {
        //设置页面抬头G
        topDiv.getElementsByTagName("label")[0].innerText = text;
        //初始化
        //var s_list = document.getElementById("s_list");
        //s_list.innerText = "";
        //apiGetSurveyList();

        //显示页面
        topDiv.style.marginTop = document.documentElement.scrollTop + "px";
        topDiv.style.display = "block";
    }

    //关
    if (mySwitch == "close") topDiv.style.display = "none";
}

function getUuid(){
    var s = [];
    var hexDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    for (var i = 0; i < 16; i++) {
        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1)
    }
    //s[14] = "4";
    //s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
    //s[8] = s[13] = s[18] = s[23] = "-";
    return s.join("")
}

function test1(ob){
    var but = ob;
    var upLoadFile = document.getElementById("upLoadFile");
    var topDiv1001 = document.getElementsByClassName("topDiv1001")[0];
    var lf = but.offsetLeft;
    var tp = but.offsetTop;
    console.log(but.offsetLeft);
    console.log(but.offsetTop);

    topDiv1001.style.marginLeft = lf + "px";
    topDiv1001.style.marginTop = tp + "px";
    upLoadFile.style.display = "block";
}
function test2(){
    var div1 = document.createElement("div");
    div1.className = "admin-upload-list";
    var img1 = document.createElement("img");
    img1.src = "https://efulidev.oss-cn-hangzhou.aliyuncs.com/koufu_image_20220822140709583253.png?Expires=1976508429&OSSAccessKeyId=LTAIEMcpIL4BsY0e&Signature=TN9uRsxLYVaYCwlD93F7c9ti%2FdU%3D";
    var div2 = document.createElement("div");
    div2.classname = "admin-upload-list-cover";
    div1.appendChild(img1);
    div1.appendChild(div2);
    document.getElementsByClassName("upload")[0].insertBefore(div1,document.getElementsByClassName("upload-btn ivu-upload")[0]);
}


